package com.lifeverse.common;

/**
 * 统一结果状态码枚举
 */
public enum ResultCode {
    
    // 成功状态码
    SUCCESS(200, "操作成功"),
    
    // 客户端错误状态码 4xx
    BAD_REQUEST(400, "请求参数错误"),
    UNAUTHORIZED(401, "未授权访问"),
    FORBIDDEN(403, "禁止访问"),
    NOT_FOUND(404, "资源不存在"),
    METHOD_NOT_ALLOWED(405, "请求方法不允许"),
    CONFLICT(409, "资源冲突"),
    VALIDATION_ERROR(422, "参数验证失败"),
    
    // 服务器错误状态码 5xx
    INTERNAL_SERVER_ERROR(500, "服务器内部错误"),
    SERVICE_UNAVAILABLE(503, "服务不可用"),
    
    // 业务错误状态码 6xxx
    BUSINESS_ERROR(6000, "业务处理失败"),
    LIFE_ENTITY_NOT_FOUND(6001, "生命体不存在"),
    CONSCIOUSNESS_STATE_ERROR(6002, "意识状态异常"),
    DNA_PROCESSING_ERROR(6003, "数字DNA处理错误"),
    NETWORK_CONNECTION_ERROR(6004, "生命体网络连接错误");
    
    private final int code;
    private final String message;
    
    ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }
    
    public int getCode() {
        return code;
    }
    
    public String getMessage() {
        return message;
    }
}